Skip to content

Copy from BitArrays to GPU arrays without scalar indexing - #849

Open
sasmith-14 wants to merge 1 commit into
JuliaGPU:mainfrom
sasmith-14:bitarray-copyto
Open

sasmith-14 wants to merge 1 commit into
JuliaGPU:mainfrom
sasmith-14:bitarray-copyto

Conversation

@sasmith-14

Copy link
Copy Markdown

Fixes #836.

copyto! from the host only handled Array sources, so a BitArray fell back to Base's elementwise copy. This converts it to a Vector on the CPU first, like the mismatched-eltype method just above it.

copyto!(JLArray{Bool}(undef, 3), BitVector([true, false, true]))  # used to throw, now works

Added tests to the copyto! testset; they fail without the fix and the full suite passes locally.

(Used Claude to help with this; I've reviewed the change.)

The host-to-device `copyto!` methods only took `Array` sources, so a
`BitArray` fell back to Base's elementwise copy. Unpack it into a
`Vector` on the CPU first, as is already done for mismatched element
types.

Fixes JuliaGPU#836

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

copyto! from a BitArray to a GPU array falls back to scalar indexing

1 participant